import request from "@/utils/request";

// 订单列表
export function fetchOrderList(query) {
  return request({
    url: "/system/order/list",
    method: "get",
    params: query,
  });
}
// 获取区域下拉框
export function fetchRegionList(query) {
  return request({
    url: "/system/region/addList",
    method: "get",
    params: query,
  });
}
// 获取门店下拉框
export function fetchStoreList(query) {
  return request({
    url: "/system/store/pullDown",
    method: "get",
    params: query,
  });
}
// 获取客户信息
export function fetchCustomInfo(params) {
  return request({
    url: "/system/zy/user/getUser",
    method: "get",
    params,
  });
}
// 获取服务项目列表
export function fetchProjectList(params) {
  return request({
    url: "/system/item/store/appList",
    method: "get",
    params,
  });
}
// 获取项目的技师列表
export function fetchTechnicianList(params) {
  return request({
    url: "/system/item/technician/webAppletList",
    method: "post",
    data: params,
  });
}

// export  function fetchTechnicianList(params) {
//   return request({
//     url: '/system/item/technician/appletList',
//     method: 'get',
//     params
//   })
// }

// 获取附加商品列表
export function fetchGoodsList(params) {
  return request({
    url: "/system/store/product/pullDown/list",
    method: "get",
    params,
  });
}
// 获取包间列表
export function fetchRoomsList(params) {
  return request({
    url: "/system/store/compartment/appletList",
    method: "get",
    params,
  });
}
/**获取包间列表*/
export function getRoomList(params) {
  return request({
    url: "/system/store/compartment/listEmptyRoom",
    method: "get",
    params,
  });
}
// 获取优惠券列表
export function fetchCouponList(params) {
  return request({
    url: "/system/userCoupon/listAppNetPay",
    method: "get",
    params,
  });
}
// 获取优惠券折扣信息
export function fetchCouponDiscount(data) {
  return request({
    url: "/system/order/calculationMoney",
    method: "post",
    data,
  });
}
// 订单退单
export function outOrder(data) {
  return request({
    url: "/system/order/chargeback",
    method: "put",
    data: data,
  });
}
// 项目退单
// export function outProjectOrder(params) {
//   return request({
//     url: '/system/order/chargebackMoney/' + params.itemId,
//     method: 'get',
//     params
//   })
// }
export function outProjectOrder(data) {
  return request({
    url: "/system/order/chargebackMoneyPC",
    method: "put",
    data: data,
  });
}
// 开单
export function addOrder(data) {
  return request({
    url: "/system/order/tcAddPC",
    method: "post",
    data: data,
  });
}

//详情
export function getorder(id) {
  return request({
    url: "/system/order/" + id,
    method: "get",
  });
}

export function listMemberUser(query) {
  return request({
    url: "/system/zy/user/getUserList",
    method: "get",
    params: query,
  });
}
//支付
export function listorderPayment(data) {
  return request({
    url: "/system/order/payment",
    method: "put",
    data: data,
  });
}
//退单
export function updateChargeback(data) {
  return request({
    url: "/system/order/chargeback",
    method: "put",
    data: data,
  });
}
//修改
export function updateitemProduct(data) {
  return request({
    url: "/system/store/manager",
    method: "put",
    data: data,
  });
}

//删除
export function deliteorder(id) {
  return request({
    url: "/system/order/" + id,
    method: "delete",
  });
}

export function listpullDownlist(query) {
  return request({
    url: "/system/item/type/pullDown/list",
    method: "get",
    params: query,
  });
}
export function liststorelist(query) {
  return request({
    url: "/system/item/store/appList",
    method: "get",
    params: query,
  });
}
export function listpullDown(query) {
  return request({
    url: "/system/store/product/pullDown/list",
    method: "get",
    params: query,
  });
}
//判断使用会员卡
export function listmemberjudgment(query) {
  return request({
    url: "/system/member/judgment",
    method: "get",
    params: query,
  });
}
export function listvaluejudgment(query) {
  return request({
    url: "/system/value/card/judgment",
    method: "get",
    params: query,
  });
}
export function listcompartment(query) {
  return request({
    url: "/system/store/compartment/appletList",
    method: "get",
    params: query,
  });
}
export function listtechnicianList(query) {
  return request({
    url: "/system/item/technician/technicianList",
    method: "get",
    params: query,
  });
}
export function listorderList(query) {
  return request({
    url: "/system/order/item/pcList",
    method: "get",
    params: query,
  });
}

export function listuserCoupon(query) {
  return request({
    url: "/system/userCoupon/listAppNetPay",
    method: "get",
    params: query,
  });
}

export function listlistAppNetPayEdit(query) {
  return request({
    url: "/system/userCoupon/listAppNetPayEdit",
    method: "get",
    params: query,
  });
}
export function listgetSubscribeDetail(query) {
  return request({
    url: "/system/technician/getSubscribeDetail",
    method: "get",
    params: query,
  });
}
//查看会员卡折扣
export function listmemberFirst(query) {
  return request({
    url: "/system/member/member/first",
    method: "get",
    params: query,
  });
}
//查看储蓄卡折扣
export function listdiscountFirst(query) {
  return request({
    url: "/system/value/card/discount/first",
    method: "get",
    params: query,
  });
}

//确认支付
export function orderPay(data) {
  return request({
    url: "/system/order/payment",
    method: "put",
    data,
  });
}

//查询列表订单数量
export function countOrder() {
  return request({
    url: "/system/order/countOrder",
    method: "get",
  });
}

//商品订单支付
export const toPaymentOrder = (data) => {
  return request({
    url: "/system/order/item/toPaymentOrderItemPC",
    method: "post",
    data,
  });
};

//计算实付金额
export const calculatePrice = (data) => {
  return request({
    url: "/system/order/item/toGetPayOrderItemMoney",
    method: "post",
    data,
  });
};

//补单支付
export const supplementOrder = (data) => {
  return request({
    url: "/system/order/item/payOrderItemPC",
    method: "post",
    data,
  });
};

//补单支付
//确认支付
export function updateOrderItem(data) {
  return request({
    url: "/system/order/item",
    method: "put",
    data,
  });
}

//门店分类
export const listTypeByStore = (data) => {
  return request({
    url: "/system/item/type/listTypeByStore",
    // url: '/system/item/typer/listTypeByStore',
    method: "get",
    params: data,
  });
};

//列表
export function listtechnician(query) {
  return request({
    url: "/system/technician/list",
    method: "get",
    params: query,
  });
}

//列表
export function payment(data) {
  return request({
    url: "/system/storeCompartmentOrder/payment",
    method: "post",
    data,
  });
}
//储值卡列表
export function ruleList(data) {
  return request({
    url: "/system/value/card/rule/list",
    method: "post",
    data,
  });
}
//项目列表
export function storeList(data) {
  return request({
    url: "/system/item/store/list",
    method: "post",
    data,
  });
}
//会员卡列表
export function memberRuleList(data) {
  return request({
    url: "/member/rule/list",
    method: "post",
    data,
  });
}
//修改订单列表
export function updateTechAndTime(data) {
  return request({
    url: "/system/order/item/updateTechAndTime",
    method: "post",
    data,
  });
}
